package com.woniuxy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.woniuxy.entity.Unpack;
import com.woniuxy.mapper.UnpackMapper;
import com.woniuxy.service.PickGoodsSevice;
import com.woniuxy.service.UnpackService;

@Service
public class UnpackServiceImpl implements UnpackService{
	@Autowired
	private UnpackMapper unpackMapper;
	@Autowired
	private PickGoodsSevice pickGoodsSevice; 

	@Override
	public List<Unpack> all(){
		return unpackMapper.all();
	}

	@Override
	public int addUnpack(Unpack unpack,int cgid) {
		pickGoodsSevice.updatePickGoodsStatus(cgid);
		return unpackMapper.addUnpack(unpack);
	}

	@Override
	public int updateUnpack(Unpack unpack) {
		// TODO Auto-generated method stub
		return unpackMapper.updateUnpack(unpack);
	}

	@Override
	public int updateCgid(int cgid) {
		// TODO Auto-generated method stub
		return unpackMapper.updateCgid(cgid);
	}

	@Override
	public List<Unpack> allUnpack() {
		
		return unpackMapper.allUnpack();
	}

	@Override
	public int updateUnpackStatus(int upid) {
		
		return unpackMapper.updateUnpackStatus(upid);
	}
	
	
}
